#ifndef _IM_SERVER_SESSION_UPDATE_TASK_
#define _IM_SERVER_SESSION_UPDATE_TASK_

#include <string>
#include "session_thread_manager.h"

namespace imserver {
class RedisSessionAdapter;
using apache::thrift::concurrency::Runnable;

class SessionUpdateTask : public Runnable {
 public:
  enum OP_TYPE {
    OP_ADD,
    OP_REMOVE
  };
  SessionUpdateTask(RedisSessionAdapter & redis_adapter, int64_t id, const std::string & session, OP_TYPE op_type)
      : redis_adapter_(redis_adapter), id_(id), session_(session), op_type_(op_type) {
  }
  virtual void run();
 private:
  RedisSessionAdapter & redis_adapter_;
  int64_t id_;
  std::string session_;
  OP_TYPE op_type_;
};

}

#endif // _IM_SERVER_SESSION_UPDATE_TASK_

